scp=zi.scopeModule();

%% Single Shot - Free Run (non-trigger)
scp.reset();

% Control Panel
scp.setMode('time');
% scp.setMode('frequency');
scp.setSamplingRate(10); 
scp.setFrameLength(1.0);
scp.enableChannel('1');
scp.inputSelect('0', 0);
% scp.inputSelect('1', 12);
scp.setAveraging(1);

% Trig Panel
% Choose one aquisition mode
%----------------------------
% scp.disableTrigger().setSingleShot();                                % single-shot, free-run (non-trigger)
% scp.enableTrigger().setTimeOut(10.0).setSingleShot();                % single-shot, trigger
scp.disableTrigger().setContinuousAcquisition(5.0);                   % continuous, free-run (non-trigger)
% scp.enableTrigger().setTimeOut(10.0).setContinuousAcquisition(20.0); % continuous, trigger
%----------------------------
scp.setTriggerChannel(8);
scp.setTriggerSlope(1);
scp.setTriggerLevel(0.1);
scp.setTriggerHysteresis(0.0);
scp.disableTriggerGating();
scp.setTriggerHoldoff(0.0);
scp.setTriggerReference(0.0);
scp.setTriggerDelay(0.0);

% run
scp.subscribeChannel();
scp_data=scp.run();
scp.unsubscribeChannel();

%%
figure('Name', 'Scope data');
scp_data_array = scp_data.getNodeData();
plot(scp_data_array.time, scp_data_array.value);